<template>
	<view>
		<cu-custom bgColor="bg-blue" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">用户详情</block>
		</cu-custom>
		<view>
			<view class="cu-list menu-avatar">
				<view class="cu-item ">
					<view class="cu-avatar round lg" v-if="form.avatarUrl" :style="'background-image:url(' + form.avatarUrl  + ')'">
					</view>
					<view class="content">
						<view class="text-black">{{form.nickName}}</view>
						<view class="text-gray text-sm flex">
							<view class="text-cut">
								{{form.phone}}
							</view>
						</view>

					</view>
				</view>
			</view>
			<view class="cu-list grid no-border col-2">
				<view class="cu-item">
					<view>
						0
					</view>
					<text>账户积分</text>
				</view>
				<view class="cu-item">
					<view>
						0
					</view>
					<text>消费次数</text>
				</view>
			</view>
			<view class="margin-tb-sm">
				<view class="cu-form-group">
					<view class="title">用户等级</view>
					<view class='cu-tag' :class="form.userGrade == '1' ?'line-red' :'line-blue'">
						{{form.userGrade == '1' ?'会员用户' :'普通用户'}}
					</view>
				</view>
				<view class="cu-form-group">
					<view class="title">累计消费</view>
					<view>0</view>
				</view>
				<view class="cu-form-group">
					<view class="title">注册日期</view>
					<view>{{form.createTime}}</view>
				</view>
				<view class="cu-form-group">
					<view class="title">来源</view>
					<view class="cu-tag line-blue">
						{{form.userSource == 'WX-MA' ?'微信小程序' : form.userSource == 'ALI-MA' ? '支付宝小程序' : form.userSource == 'H5' ? '普通H5' : form.userSource == 'APP' ? 'APP' :'未知'}}
					</view>
				</view>
				<view class="cu-form-group">
					<view class="title">地区</view>
					<view>{{form.province}}-{{form.city}}</view>
				</view>
			</view>


		</view>

	</view>
</template>

<script>
	import {
		getObj
	} from '@/api/mall/userinfo.js'
	export default {
		data() {
			return {
				form: {}
			}
		},
		onLoad(props) {
			this.getDetail(props.id);
		},
		methods: {
			getDetail(id) {
				getObj(id).then(res => {
					this.form = res.data
				})
			}
		},
	}
</script>

<style>
</style>
